/*
package com.chuanggou.controller;

import com.chuanggou.goods.pojo1.Brand;

import com.chuanggou.goods.service.BrandService;
import com.github.pagehelper.PageInfo;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

*/
/**
 * @author yd
 * @version 1.0
 * @date 2020/2/24 0024 黄啟军
 *//*

@RestController
@RequestMapping(value = "/brand")
@CrossOrigin //跨域：A域名访问B域名的数据，此时存在跨域，域名或请求端口或协议不一致则为跨域
public class BrandController1 {
    @Autowired
    private BrandService brandService;
    */
/**分页加条件查询*//*

    @PostMapping(value = "/search/{page}/{size}")
    public Result<PageInfo<Brand>> findPage(@RequestBody Brand brand,
                                            @PathVariable(value = "page")Integer page,//当前页
                                            @PathVariable(value = "size")Integer size){ //每页显示的条数
        //调用service实现查询
        PageInfo<Brand> pageInfo = brandService.findPage(brand,page, size);
        return new Result<PageInfo<Brand>>(true, StatusCode.OK,"分页查询成功",pageInfo);
    }
    */
/**分页查询*//*

    @GetMapping(value = "/search/{page}/{size}")
    public Result<PageInfo<Brand>> findPage(@PathVariable(value = "page")Integer page,//当前页
                                    @PathVariable(value = "size")Integer size){ //每页显示的条数
          //调用service实现查询
        PageInfo<Brand> pageInfo = brandService.findPage(page, size);
        return new Result<PageInfo<Brand>>(true, StatusCode.OK,"分页查询成功",pageInfo);
    }

    */
/**条件查询*//*

    @PostMapping(value = "/search")
    public Result<List<Brand>> findList(@RequestBody Brand brand){
        //调用Service
        List<Brand> brands = brandService.findList(brand);
        return new Result<List<Brand>>(true, StatusCode.OK,"条件搜索查询成功",brands);
    }
      */
/**查询所有品牌*//*

      @GetMapping
      public Result<List<Brand>> findAll(){
         //查询所有品牌
         List<Brand> brands = brandService.findAll();
         //参数：操作成功--状态码--提示信息--页面要的数据
          //响应结果封装
         return new Result<List<Brand>>(true, StatusCode.OK,"查询品牌集合成功",brands);
      }
      */
/**根据主键查询*//*

      @GetMapping("/{id}")
      public Result<Brand> findById(@PathVariable(value = "id")Integer id){
                //调用service实现查询
          Brand brand = brandService.findById(id);
          //响应数据封装
          return new Result<Brand>(true, StatusCode.OK,"根据id查询成功",brand);
      }
      */
/**增加品牌 要去是json格式@ResponseBody*//*

      @PostMapping
      public Result add(@RequestBody Brand brand){
         //调用service实现操作
          brandService.add(brand);
          return new Result(true, StatusCode.OK,"增加品牌成功");
      }
      */
/**根据id修改品牌*//*

      @PutMapping(value = "/{id}")
      public Result update( @PathVariable(value = "id")Integer id , @RequestBody Brand brand){
            //将ID给brand
          brand.setId(id);
          //调用service实现修改
          brandService.update(brand);
          return new Result(true, StatusCode.OK,"修改成功");
      }
      */
/**根据id实现删除*//*

      @DeleteMapping(value = "/{id}")
      public Result delete(@PathVariable(value = "id")Integer id){
         //调用service实现删除
         brandService.detele(id);
          return new Result(true, StatusCode.OK,"删除成功");
      }
}
*/
